package com.gmail.blackdog1987.onedollar.entity;

import javax.persistence.*;

/**
 * Created by dongguochao on 12/7/15.
 */
@Entity
@Table(name = "sys_param", schema = "", catalog = "onedollar")
public class SysParamEntity {
    private int id;
    private String code;
    private String name;
    private String typeCode;
    private String typeName;
    private String valueType;
    private String minValue;
    private String maxValue;
    private Integer minIvalue;
    private Integer maxIvalue;
    private String memo;

    @Id
    @Column(name = "id", nullable = false, insertable = true, updatable = true)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "code", nullable = true, insertable = true, updatable = true, length = 32)
    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    @Basic
    @Column(name = "name", nullable = true, insertable = true, updatable = true, length = 32)
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "type_code", nullable = true, insertable = true, updatable = true, length = 2)
    public String getTypeCode() {
        return typeCode;
    }

    public void setTypeCode(String typeCode) {
        this.typeCode = typeCode;
    }

    @Basic
    @Column(name = "type_name", nullable = true, insertable = true, updatable = true, length = 32)
    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    @Basic
    @Column(name = "value_type", nullable = true, insertable = true, updatable = true, length = 1)
    public String getValueType() {
        return valueType;
    }

    public void setValueType(String valueType) {
        this.valueType = valueType;
    }

    @Basic
    @Column(name = "min_value", nullable = true, insertable = true, updatable = true, length = 32)
    public String getMinValue() {
        return minValue;
    }

    public void setMinValue(String minValue) {
        this.minValue = minValue;
    }

    @Basic
    @Column(name = "max_value", nullable = true, insertable = true, updatable = true, length = 32)
    public String getMaxValue() {
        return maxValue;
    }

    public void setMaxValue(String maxValue) {
        this.maxValue = maxValue;
    }

    @Basic
    @Column(name = "min_ivalue", nullable = true, insertable = true, updatable = true)
    public Integer getMinIvalue() {
        return minIvalue;
    }

    public void setMinIvalue(Integer minIvalue) {
        this.minIvalue = minIvalue;
    }

    @Basic
    @Column(name = "max_ivalue", nullable = true, insertable = true, updatable = true)
    public Integer getMaxIvalue() {
        return maxIvalue;
    }

    public void setMaxIvalue(Integer maxIvalue) {
        this.maxIvalue = maxIvalue;
    }

    @Basic
    @Column(name = "memo", nullable = true, insertable = true, updatable = true, length = 32)
    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SysParamEntity that = (SysParamEntity) o;

        if (id != that.id) return false;
        if (code != null ? !code.equals(that.code) : that.code != null) return false;
        if (name != null ? !name.equals(that.name) : that.name != null) return false;
        if (typeCode != null ? !typeCode.equals(that.typeCode) : that.typeCode != null) return false;
        if (typeName != null ? !typeName.equals(that.typeName) : that.typeName != null) return false;
        if (valueType != null ? !valueType.equals(that.valueType) : that.valueType != null) return false;
        if (minValue != null ? !minValue.equals(that.minValue) : that.minValue != null) return false;
        if (maxValue != null ? !maxValue.equals(that.maxValue) : that.maxValue != null) return false;
        if (minIvalue != null ? !minIvalue.equals(that.minIvalue) : that.minIvalue != null) return false;
        if (maxIvalue != null ? !maxIvalue.equals(that.maxIvalue) : that.maxIvalue != null) return false;
        if (memo != null ? !memo.equals(that.memo) : that.memo != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (code != null ? code.hashCode() : 0);
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (typeCode != null ? typeCode.hashCode() : 0);
        result = 31 * result + (typeName != null ? typeName.hashCode() : 0);
        result = 31 * result + (valueType != null ? valueType.hashCode() : 0);
        result = 31 * result + (minValue != null ? minValue.hashCode() : 0);
        result = 31 * result + (maxValue != null ? maxValue.hashCode() : 0);
        result = 31 * result + (minIvalue != null ? minIvalue.hashCode() : 0);
        result = 31 * result + (maxIvalue != null ? maxIvalue.hashCode() : 0);
        result = 31 * result + (memo != null ? memo.hashCode() : 0);
        return result;
    }
}
